package com.itheima.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

//处理类
@Controller
@RequestMapping("user")//一级url路径
public class UserController {//单例
    /*
    * method:指定请求方式
    *  get
    *  post
    *  put
    *  delete
    *
    * value/path:指定url路径
    *params:指定请求的参数或者参数和值
    * headers:指定请求头信息
    * produces:设置响应的文档类型及字符集编码(@ResponesBody注解)
    * */
    @RequestMapping(value = "findAll",method = RequestMethod.GET,params = {"username"})
    public void findAll(){
        System.out.println("findAll");
    }

    @RequestMapping("test1")//指定请求的URL  二级url路径   一级:
    public String text1(){
        System.out.println("text1....");
        return "index";//视图名称
    }

    @RequestMapping("text2")
    public void text2(){
        System.out.println("text2....");
    }

}
